<template>
<div class='app-container'>

    <!--步骤导航-->
    <h2 style="text-align:center;">发布新课程</h2>
    <el-steps :active="active" finish-status="success" simple>
        <el-step title="填写课程基本信息" icon="el-icon-edit"></el-step>
        <el-step title="创建课程大纲" icon="el-icon-loading"></el-step>
        <el-step title="发布课程" icon="el-icon-loading"></el-step>
    </el-steps>

    <!--步骤内容-->
    <!--steep1：Info-->
    <Info v-if="active===0" />

    <!--steep2：ChapterIndex-->
    <Chapter v-if="active===1" />

    <!--steep3：Publish-->
    <Publish v-if="active===2 || active===3" />

</div>
</template>

<script>
import Info from '@/views/course/components/Info'
import Chapter from '@/views/course/components/Chapter' //````+'/Index.vue'
import Publish from '@/views/course/components/Publish'

export default {
    name: '',
    props: {},
    components: {
        Info,
        Chapter,
        Publish
    },
    data() {
        return {
            active: 0,
            courseId: null
        };
    },
    computed: {},
    watch: {},
    methods: {},
    created() {
        //通过获取路由名称判断是编辑修改还是章节修改
        if (this.$route.name == "CourseInfoEdit") {
            this.courseId = this.$route.params.id
            this.active = 0
        } else if (this.$route.name == "CourseChapterEdit") {
            this.courseId = this.$route.params.id
            this.active = 1
        }
    },
    mounted() {},
    beforeDestroy() {}
};
</script>

<style>
</style>
